<template>
  <div class="anime-container">
    <AppHeader />

    <div class="content-wrapper">
      <!-- 侧边导航 -->
      <SideNav 
        :title="'番剧频道'"
        :tabs="tabs"
        :active-tab="activeTab"
        @tab-click="handleTabClick"
      />

      <!-- 主要内容区域 -->
      <main class="anime-main">
        <!-- 推荐番剧 -->
        <section v-if="activeTab === 'recommend'" class="anime-section">
          <h2 class="section-title">推荐番剧</h2>
          
          <!-- 精选番剧轮播 -->
        <div class="featured-carousel">
          <div class="carousel-item" v-for="(anime, index) in featuredAnimes" :key="index" :class="{ active: currentSlide === index }">
            <div class="carousel-content" @click="openAnimeDetail(anime)">
              <img :src="anime.banner" :alt="anime.title" class="carousel-image" />
              <div class="carousel-info">
                <h3 class="carousel-title">{{ anime.title }}</h3>
                <p class="carousel-desc">{{ anime.description }}</p>
                <div class="carousel-meta">
                  <span class="meta-item">{{ anime.category }}</span>
                  <span class="meta-item">{{ anime.episodes }}话</span>
                  <span class="meta-item score">{{ anime.score }}分</span>
                </div>
                <div class="carousel-actions">
                  <button class="btn-play" @click.stop="playAnime(anime)">立即观看</button>
                  <button class="btn-favorite" @click.stop="toggleFavorite(anime)">收藏</button>
                </div>
              </div>
            </div>
          </div>
            
            <!-- 轮播控制 -->
            <div class="carousel-controls">
              <button class="carousel-prev" @click="prevSlide">&lt;</button>
              <button class="carousel-next" @click="nextSlide">&gt;</button>
            </div>
            
            <!-- 轮播指示器 -->
            <div class="carousel-indicators">
              <button 
                v-for="(anime, index) in featuredAnimes" 
                :key="index"
                class="indicator" 
                :class="{ active: currentSlide === index }"
                @click="currentSlide = index"
              ></button>
            </div>
          </div>

          <!-- 热门番剧 -->
          <div class="hot-animes-section">
            <h3 class="category-title">热门番剧</h3>
            <div class="anime-grid">
              <div 
                v-for="anime in hotAnimes" 
                :key="anime.id" 
                class="anime-card"
                @click="openAnimeDetail(anime)"
              >
                <div class="anime-cover">
                  <div :style="{ background: anime.cover }" class="cover-bg"></div>
                  <div v-if="anime.isNew" class="new-badge">新番</div>
                  <div v-if="anime.isExclusive" class="vip-badge">独家</div>
                  <div class="anime-episode">{{ anime.currentEpisode }}话</div>
                </div>
                <h4 class="anime-title">{{ anime.title }}</h4>
                <div class="anime-meta">
                  <span class="anime-score">{{ anime.score }}</span>
                  <span class="anime-category">{{ anime.category }}</span>
                </div>
                <div class="anime-stats">
                  <span class="stat-item">{{ anime.viewCount }}人在看</span>
                </div>
              </div>
            </div>
          </div>
        </section>

        <!-- 最新番剧 -->
        <section v-else-if="activeTab === 'new'" class="anime-section">
          <h2 class="section-title">最新番剧</h2>
          <div class="filter-bar">
            <div class="filter-options">
              <button 
                v-for="filter in filters" 
                :key="filter.key" 
                class="filter-button"
                :class="{ active: activeFilter === filter.key }"
                @click="activeFilter = filter.key"
              >
                {{ filter.name }}
              </button>
            </div>
            <div class="sort-options">
              <select v-model="sortBy" class="sort-select">
                <option value="newest">最新更新</option>
                <option value="popularity">人气优先</option>
                <option value="score">评分优先</option>
              </select>
            </div>
          </div>
          
          <div class="anime-grid">
            <div 
              v-for="anime in newAnimes" 
              :key="anime.id" 
              class="anime-card"
              @click="openAnimeDetail(anime)"
            >
              <div class="anime-cover">
                <img :src="anime.cover" :alt="anime.title" />
                <div class="new-badge">新番</div>
                <div class="update-date">{{ anime.updateDate }}</div>
                <div class="anime-episode">{{ anime.currentEpisode }}话</div>
              </div>
              <h4 class="anime-title">{{ anime.title }}</h4>
              <div class="anime-meta">
                <span class="anime-score">{{ anime.score }}</span>
                <span class="anime-category">{{ anime.category }}</span>
              </div>
            </div>
          </div>
        </section>

        <!-- 番剧分类 -->
        <section v-else-if="activeTab === 'categories'" class="anime-section">
          <h2 class="section-title">番剧分类</h2>
          
          <div class="category-grid">
            <div 
              v-for="category in animeCategories" 
              :key="category.id" 
              class="category-card"
              @click="browseCategory(category)"
            >
              <div class="category-icon">{{ category.icon }}</div>
              <h4 class="category-name">{{ category.name }}</h4>
              <p class="category-count">{{ category.animeCount }}部番剧</p>
            </div>
          </div>
        </section>

        <!-- 我的番剧 -->
        <section v-else-if="activeTab === 'my'" class="anime-section">
          <h2 class="section-title">我的番剧</h2>
          
          <div class="my-animes-tabs">
            <button 
              v-for="tab in myAnimesTabs" 
              :key="tab.key" 
              class="tab-button"
              :class="{ active: activeMyAnimesTab === tab.key }"
              @click="activeMyAnimesTab = tab.key"
            >
              {{ tab.name }}
            </button>
          </div>
          
          <div v-if="activeMyAnimesTab === 'watching'" class="anime-grid">
            <div 
              v-for="anime in watchingAnimes" 
              :key="anime.id" 
              class="anime-card"
              @click="openAnimeDetail(anime)"
            >
              <div class="anime-cover">
                <img :src="anime.cover" :alt="anime.title" />
                <div class="progress-bar">
                  <div class="progress" :style="{ width: anime.progress + '%' }"></div>
                </div>
                <div class="anime-episode">已看{{ anime.currentEpisode }}话</div>
              </div>
              <h4 class="anime-title">{{ anime.title }}</h4>
              <div class="anime-progress">进度: {{ anime.progress }}%</div>
              <button class="btn-continue" @click.stop="continueWatching(anime)">继续观看</button>
            </div>
          </div>
          
          <div v-else-if="activeMyAnimesTab === 'favorites'" class="anime-grid">
            <div 
              v-for="anime in favoriteAnimes" 
              :key="anime.id" 
              class="anime-card"
              @click="openAnimeDetail(anime)"
            >
              <div class="anime-cover">
                <img :src="anime.cover" :alt="anime.title" />
                <div class="favorite-icon">❤️</div>
                <div class="anime-episode">{{ anime.currentEpisode }}话</div>
              </div>
              <h4 class="anime-title">{{ anime.title }}</h4>
              <div class="anime-meta">
                <span class="anime-score">{{ anime.score }}</span>
                <span class="anime-category">{{ anime.category }}</span>
              </div>
            </div>
          </div>
        </section>
      </main>
    </div>
    
    <footer class="app-footer">
      <div class="footer-content">
        <p>© 2024 番剧频道 - 版权所有</p>
      </div>
    </footer>
  </div>
</template>

<script>
import { ref, onMounted } from 'vue'
import AppHeader from '../components/AppHeader.vue'
import SideNav from '../components/SideNav.vue'

export default {
  name: 'AnimeView',
  components: {
    AppHeader,
    SideNav
  },
  methods: {
    handleTabClick(tabKey) {
      this.activeTab = tabKey
    }
  },
  setup() {
    // 导航标签
    const tabs = ref([
      { key: 'recommend', name: '推荐' },
      { key: 'new', name: '最新' },
      { key: 'categories', name: '分类' },
      { key: 'my', name: '我的', badge: '2' }
    ])
    
    const activeTab = ref('recommend')
    const currentSlide = ref(0)
    const filters = ref([
      { key: 'all', name: '全部' },
      { key: 'action', name: '热血' },
      { key: 'fantasy', name: '奇幻' },
      { key: 'romance', name: '恋爱' },
      { key: 'comedy', name: '搞笑' }
    ])
    const activeFilter = ref('all')
    const sortBy = ref('newest')
    const myAnimesTabs = ref([
      { key: 'watching', name: '正在看' },
      { key: 'favorites', name: '我的收藏' }
    ])
    const activeMyAnimesTab = ref('watching')

    // 精选番剧数据
    const featuredAnimes = ref([
      {
        id: 1,
        title: '鬼灭之刃 锻刀村篇',
        description: '炭治郎等人在锻刀村进行修炼，同时面临新的敌人威胁',
        banner: 'https://picsum.photos/id/1/1200/400',
        cover: 'linear-gradient(135deg, #ff6b6b, #ee5a24)',
        category: '热血/奇幻',
        episodes: 12,
        score: 9.8
      },
      {
        id: 2,
        title: '间谍过家家 第2季',
        description: '约尔和黄昏继续他们的间谍任务，与此同时家庭生活也在升温',
        banner: 'https://picsum.photos/id/2/1200/400',
        cover: 'linear-gradient(135deg, #54a0ff, #0984e3)',
        category: '搞笑/间谍',
        episodes: 13,
        score: 9.6
      },
      {
        id: 3,
        title: '孤独摇滚！',
        description: '社交恐惧症少女加入乐队，开始了音乐之旅',
        banner: 'https://picsum.photos/id/3/1200/400',
        cover: 'linear-gradient(135deg, #a29bfe, #6c5ce7)',
        category: '音乐/日常',
        episodes: 12,
        score: 9.7
      }
    ])

    // 热门番剧数据
    const hotAnimes = ref([
      {
        id: 1,
        title: '进击的巨人 最终季 Part.3',
        cover: 'linear-gradient(135deg, #ff7675, #e17055)',
        score: 9.9,
        category: '热血/奇幻',
        viewCount: 5000000,
        currentEpisode: 2,
        isNew: true,
        isExclusive: true
      },
      {
        id: 2,
        title: '原神 风花的邀约',
        cover: 'linear-gradient(135deg, #00b894, #00cec9)',
        score: 9.5,
        category: '奇幻/冒险',
        viewCount: 3000000,
        currentEpisode: 6,
        isNew: true,
        isExclusive: false
      },
      {
        id: 3,
        title: '辉夜大小姐想让我告白 -Ultra Romantic-',
        cover: 'linear-gradient(135deg, #fd79a8, #e84393)',
        score: 9.4,
        category: '恋爱/搞笑',
        viewCount: 2500000,
        currentEpisode: 12,
        isNew: false,
        isExclusive: false
      },
      {
        id: 4,
        title: '无职转生 第2季',
        cover: 'linear-gradient(135deg, #fdcb6e, #e17055)',
        score: 9.3,
        category: '奇幻/冒险',
        viewCount: 2000000,
        currentEpisode: 8,
        isNew: false,
        isExclusive: false
      },
      {
        id: 5,
        title: '灵能百分百 第3季',
        cover: 'linear-gradient(135deg, #74b9ff, #0984e3)',
        score: 9.7,
        category: '热血/超能力',
        viewCount: 3500000,
        currentEpisode: 12,
        isNew: false,
        isExclusive: true
      },
      {
        id: 6,
        title: '葬送的芙莉莲',
        cover: 'linear-gradient(135deg, #6c5ce7, #a29bfe)',
        score: 9.6,
        category: '奇幻/冒险',
        viewCount: 1800000,
        currentEpisode: 10,
        isNew: true,
        isExclusive: false
      }
    ])

    // 新番剧数据
    const newAnimes = ref([
      {
        id: 101,
        title: '魔都精兵的奴隶',
        cover: 'linear-gradient(135deg, #ff7675, #d63031)',
        score: 8.9,
        category: '奇幻/战斗',
        updateDate: '2024-01-15',
        currentEpisode: 5
      },
      {
        id: 102,
        title: '放学后失眠的你',
        cover: 'linear-gradient(135deg, #fd79a8, #fdcb6e)',
        score: 9.2,
        category: '青春/恋爱',
        updateDate: '2024-01-14',
        currentEpisode: 6
      },
      {
        id: 103,
        title: '冰海战记 第2季',
        cover: 'linear-gradient(135deg, #74b9ff, #0984e3)',
        score: 9.5,
        category: '历史/冒险',
        updateDate: '2024-01-12',
        currentEpisode: 10
      },
      {
        id: 104,
        title: '虚构推理 第2季',
        cover: 'linear-gradient(135deg, #a29bfe, #6c5ce7)',
        score: 8.8,
        category: '推理/奇幻',
        updateDate: '2024-01-10',
        currentEpisode: 7
      },
      {
        id: 105,
        title: '地狱乐',
        cover: 'linear-gradient(135deg, #ff6b6b, #ee5a24)',
        score: 9.1,
        category: '热血/奇幻',
        updateDate: '2024-01-09',
        currentEpisode: 8
      },
      {
        id: 106,
        title: '久保同学不放过我',
        cover: 'linear-gradient(135deg, #fd79a8, #e84393)',
        score: 9.0,
        category: '恋爱/校园',
        updateDate: '2024-01-08',
        currentEpisode: 9
      }
    ])

    // 番剧分类
    const animeCategories = ref([
      { id: '1', name: '热血', icon: '⚔️', animeCount: 156 },
      { id: '2', name: '奇幻', icon: '🧙', animeCount: 128 },
      { id: '3', name: '恋爱', icon: '💕', animeCount: 145 },
      { id: '4', name: '搞笑', icon: '😂', animeCount: 112 },
      { id: '5', name: '日常', icon: '🏠', animeCount: 98 },
      { id: '6', name: '科幻', icon: '🚀', animeCount: 87 },
      { id: '7', name: '校园', icon: '📚', animeCount: 134 },
      { id: '8', name: '悬疑', icon: '🔍', animeCount: 76 },
      { id: '9', name: '百合', icon: '🌸', animeCount: 65 },
      { id: '10', name: 'BL', icon: '💜', animeCount: 59 },
      { id: '11', name: '音乐', icon: '🎵', animeCount: 42 },
      { id: '12', name: '冒险', icon: '🏕️', animeCount: 108 }
    ])

    // 正在观看
    const watchingAnimes = ref([
      {
        id: 201,
        title: '鬼灭之刃 锻刀村篇',
        cover: 'linear-gradient(135deg, #ff6b6b, #ee5a24)',
        currentEpisode: 8,
        progress: 67
      },
      {
        id: 202,
        title: '间谍过家家 第2季',
        cover: 'linear-gradient(135deg, #54a0ff, #0984e3)',
        currentEpisode: 10,
        progress: 77
      },
      {
        id: 203,
        title: '孤独摇滚！',
        cover: 'linear-gradient(135deg, #a29bfe, #6c5ce7)',
        currentEpisode: 12,
        progress: 100
      }
    ])

    // 收藏番剧
    const favoriteAnimes = ref([
      {
        id: 301,
        title: '进击的巨人 最终季',
        cover: 'linear-gradient(135deg, #ff7675, #e17055)',
        score: 9.9,
        category: '热血/奇幻',
        currentEpisode: 2
      },
      {
        id: 302,
        title: '灵能百分百 第3季',
        cover: 'linear-gradient(135deg, #74b9ff, #0984e3)',
        score: 9.7,
        category: '热血/超能力',
        currentEpisode: 12
      },
      {
        id: 303,
        title: '辉夜大小姐想让我告白',
        cover: 'linear-gradient(135deg, #fd79a8, #e84393)',
        score: 9.4,
        category: '恋爱/搞笑',
        currentEpisode: 12
      },
      {
        id: 304,
        title: '葬送的芙莉莲',
        cover: 'linear-gradient(135deg, #6c5ce7, #a29bfe)',
        score: 9.6,
        category: '奇幻/冒险',
        currentEpisode: 10
      }
    ])

    // 轮播控制
    const prevSlide = () => {
      currentSlide.value = (currentSlide.value - 1 + featuredAnimes.value.length) % featuredAnimes.value.length
    }

    const nextSlide = () => {
      currentSlide.value = (currentSlide.value + 1) % featuredAnimes.value.length
    }

    // 番剧操作
    const openAnimeDetail = (anime) => {
      console.log('打开番剧详情:', anime.title)
      // 实际应用中应使用路由跳转
    }

    const playAnime = (anime) => {
      console.log('开始观看番剧:', anime.title)
    }

    const toggleFavorite = (anime) => {
      console.log('切换收藏状态:', anime.title)
    }

    const browseCategory = (category) => {
      console.log('浏览分类:', category.name)
    }

    const continueWatching = (anime) => {
      console.log('继续观看番剧:', anime.title)
    }

    onMounted(() => {
      // 自动轮播
      let interval = setInterval(() => {
        nextSlide()
      }, 5000)

      // 添加鼠标悬停暂停自动轮播
      const carousel = document.querySelector('.featured-carousel')
      if (carousel) {
        carousel.addEventListener('mouseenter', () => {
          clearInterval(interval)
        })
        carousel.addEventListener('mouseleave', () => {
          interval = setInterval(() => {
            nextSlide()
          }, 5000)
        })
      }

      // 清理
      return () => {
        clearInterval(interval)
        if (carousel) {
          carousel.removeEventListener('mouseenter', () => {})
          carousel.removeEventListener('mouseleave', () => {})
        }
      }
    })

    return {
      tabs,
      activeTab,
      currentSlide,
      filters,
      activeFilter,
      sortBy,
      myAnimesTabs,
      activeMyAnimesTab,
      featuredAnimes,
      hotAnimes,
      newAnimes,
      animeCategories,
      watchingAnimes,
      favoriteAnimes,
      prevSlide,
      nextSlide,
      openAnimeDetail,
      playAnime,
      toggleFavorite,
      browseCategory,
      continueWatching
    }
  }
}
</script>

<style scoped>
.anime-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f5f7fa;
}

.content-wrapper {
  display: flex;
  flex: 1;
}

.anime-main {
  flex: 1;
  max-width: calc(100% - 240px);
  margin: 0;
  padding: 20px 30px;
}

.anime-section {
  margin-bottom: 40px;
}

.section-title {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 20px;
  color: #333;
}

/* 轮播样式 */
.featured-carousel {
  position: relative;
  height: 400px;
  margin-bottom: 40px;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.carousel-item {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 1;
}

.carousel-item.active {
  opacity: 1;
  z-index: 2;
}

.carousel-content {
  height: 100%;
  display: flex;
  position: relative;
  cursor: pointer;
}

.carousel-image {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

.cover-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

.carousel-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: #fff;
}

.carousel-title {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 10px;
}

.carousel-desc {
  font-size: 16px;
  margin-bottom: 15px;
  opacity: 0.9;
  max-width: 800px;
}

.carousel-meta {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  font-size: 14px;
  opacity: 0.9;
}

.meta-item {
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 15px;
}

.meta-item.score {
  background: #ff6b6b;
  color: #fff;
  font-weight: 600;
}

.carousel-actions {
  display: flex;
  gap: 15px;
}

.btn-play, .btn-favorite {
  padding: 12px 24px;
  border: none;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-play {
  background: #2ed573;
  color: #fff;
}

.btn-play:hover {
  background: #20bf6b;
  transform: translateY(-2px);
}

.btn-favorite {
  background: #fff;
  color: #333;
}

.btn-favorite:hover {
  background: #f0f0f0;
  transform: translateY(-2px);
}

.carousel-controls {
  position: absolute;
  top: 50%;
  left: 20px;
  right: 20px;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  z-index: 10;
}

.carousel-prev, .carousel-next {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-prev:hover, .carousel-next:hover {
  background: rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
}

.carousel-indicators {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}

.indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.indicator.active {
  background: #fff;
  transform: scale(1.2);
}

/* 番剧卡片网格 */
.anime-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.anime-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
}

.anime-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.anime-cover {
  position: relative;
  width: 100%;
  padding-top: 140%; /* 3:4 宽高比，适合番剧封面 */
  overflow: hidden;
}

.anime-cover img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.anime-card:hover .anime-cover img {
  transform: scale(1.05);
}

.new-badge, .vip-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.new-badge {
  background: #ff4757;
  color: #fff;
}

.vip-badge {
  background: #ff9ff3;
  color: #fff;
}

.anime-episode, .update-date {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.update-date {
  bottom: 40px;
  background: rgba(46, 213, 115, 0.9);
}

.favorite-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 24px;
  opacity: 0.9;
}

.progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(0, 0, 0, 0.3);
}

.progress {
  height: 100%;
  background: #2ed573;
  transition: width 0.3s ease;
}

.anime-title {
  padding: 12px;
  font-size: 16px;
  font-weight: 500;
  color: #333;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.anime-meta {
  padding: 0 12px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.anime-score {
  color: #ff6b6b;
  font-weight: 600;
}

.anime-category {
  color: #666;
  background: #f0f0f0;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
}

.anime-stats {
  padding: 0 12px 12px;
  font-size: 12px;
  color: #999;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.anime-progress {
  padding: 0 12px 8px;
  font-size: 14px;
  color: #666;
}

.btn-continue {
  margin: 0 12px 12px;
  padding: 8px 16px;
  background: #2ed573;
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: calc(100% - 24px);
}

.btn-continue:hover {
  background: #20bf6b;
  transform: translateY(-1px);
}

/* 分类卡片 */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.category-card {
  background: #fff;
  border-radius: 12px;
  padding: 30px 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  background: #f0f9ff;
}

.category-icon {
  font-size: 48px;
  margin-bottom: 15px;
}

.category-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
}

.category-count {
  font-size: 14px;
  color: #999;
}

/* 筛选栏 */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  background: #fff;
  padding: 15px 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.filter-options {
  display: flex;
  gap: 10px;
}

.filter-button {
  padding: 8px 16px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-button:hover {
  border-color: #2ed573;
  color: #2ed573;
}

.filter-button.active {
  background: #2ed573;
  color: #fff;
  border-color: #2ed573;
}

.sort-select {
  padding: 8px 16px;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
}

/* 我的番剧标签 */
.my-animes-tabs {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #eee;
}

.tab-button {
  padding: 10px 20px;
  border: none;
  background: none;
  font-size: 16px;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.tab-button:hover {
  color: #2ed573;
}

.tab-button.active {
  color: #2ed573;
}

.tab-button.active::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 0;
  right: 0;
  height: 2px;
  background: #2ed573;
}

/* 页脚 */
.app-footer {
  background: #2c3e50;
  color: #ecf0f1;
  padding: 30px 0;
  text-align: center;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 响应式布局 */
@media (max-width: 1200px) {
  .anime-main {
    max-width: calc(100% - 200px);
    padding: 15px 20px;
  }
  
  .anime-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

@media (max-width: 768px) {
  .content-wrapper {
    flex-direction: column;
  }
  
  .anime-main {
    max-width: 100%;
  }
  
  .anime-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  
  .filter-bar {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }
  
  .filter-options {
    flex-wrap: wrap;
    justify-content: center;
  }
}
</style>